/*
 * jFrameMain.java
 * Copyright (c) 2006, FMap
 *
 * Created on 12 de diciembre de 2005, 22:41
 */

package fmap.gui;

import javax.swing.JButton;
import javax.swing.JTextField;
import fmap.DatosCompartidos;
import fmap.gui.actionListener.ListenerJTabbedPane;
import fmap.gui.actionListener.ListenerJFrameMain;
import fmap.gui.actionListener.ListenerJFrameAdminCollection;
import fmap.gui.jTreePersonal.TreeModelPersonal;
import fmap.model.Collection;
import fmap.utils.FormUtils;
import java.awt.Color;
import java.awt.Event;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyEvent;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTabbedPane;
import javax.swing.KeyStroke;

import com.sun.java.swing.plaf.gtk.GTKLookAndFeel;
import javax.swing.UIManager;

/**
 * Clase que extiende de JFrame y construye la interfaz principal del programa
 *
 * @author  Javier Sanroman Araujo
 * @version 1.1
 */
public class JFrameMain extends javax.swing.JFrame
{
    
    FixedGlassPane glass;
    
    /** Constructor */
    public JFrameMain ()
    {
        initComponents ();


/*
try{
UIManager.setLookAndFeel( new GTKLookAndFeel() );
//SwingUtilities.updateComponentTreeUI( java1426.this );
        } catch( Exception e ) {
          System.err.println( "No se puede cambiar al LookAndFeel: ");
        }
*/
        
        Collection[] aCol = DatosCompartidos.getACollection ();
        // Enviamos el modelo de datos al combo de colecciones de este JFrame
        comboCollection.setModel ( new DefaultComboBoxModel ( aCol ) );
        // Seleccionamos la coleccion abierta
        for( int i=0; i<aCol.length; i++ )
        {
//            if( aCol[i].getId () == DatosCompartidos.getIDCollectionOpen () )
            if( aCol[i].getId () == DatosCompartidos.getCollectionActual ().getId ())
                comboCollection.setSelectedItem ( aCol[i] );
        }
        
        
        // Si tenemos alguna coleccion abierta cargamos los jTree's  y activamos los controles del formulario
//        if( DatosCompartidos.getIDCollectionOpen () != -1 )
        if( DatosCompartidos.getCollectionActual ().getId () != -1 )
        {
            DatosCompartidos.getJTreePersonal ().setModel ( new TreeModelPersonal ( DatosCompartidos.getCollectionActual () ) );
            DatosCompartidos.getJTreePersonal ().setVisible ( true );
            lblMsj.setVisible ( false );
            activeComponents ();
        }
        else
        {
            lblMsj.setVisible ( true );
            desActiveComponents ();
        }
        
        
        jspp.getViewport ().add ( DatosCompartidos.getJTablePersonal () );
        jspp.getViewport ().setBackground (Color.WHITE);
        
        jspResultSearch.setBackground ( Color.WHITE );
        
        
        JScrollPane jspr = new JScrollPane ( DatosCompartidos.getPanelRight () );
        
        jspr.getViewport ().add ( DatosCompartidos.getPanelRight () );
        jSplitPane3.setRightComponent (jspr);
        
        pestana.addChangeListener ( new ListenerJTabbedPane ());
        
        pestana.setTitleAt (0, "  Ficheros     ");
        pestana.setIconAt (0, new ImageIcon ( getClass ().getResource ("/fmap/img/explorer_p.png") ));
        pestana.setTitleAt (1, "  Resultados Búsqueda     ");
        pestana.setIconAt (1, new ImageIcon ( getClass ().getResource ("/fmap/img/find_p.png") ));
        
        jSplitPane1.setLeftComponent ( new JScrollPane ( DatosCompartidos.getJTreePersonal () ) );

//        jPanel4.add (new JScrollPane ( DatosCompartidos.getJTreePersonal () ));

        jSplitPane1.setRightComponent ( jSplitPane3 );
        
        ListenerJFrameMain listener = new ListenerJFrameMain ();
        
        // Añadimos los listeners a los componentes
        buttonAdminCollection.addActionListener ( listener );
        buttonNewMapF.addActionListener ( listener );
        buttonSearch.addActionListener ( listener );
        jTxtBuscador.addActionListener ( listener );
        jTxtBuscador.setActionCommand ("search");
        jTxtBuscador.addFocusListener (new FocusTxtBuscador ());
        

        menuItemNewMapF.setMnemonic (new Character('A'));
        menuItemCatMapF.setMnemonic (KeyEvent.VK_S);
        
menuItemNewMapF.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R,Event.ALT_MASK));
menuItemSearchAdvanced.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F,Event.CTRL_MASK));
        
        menuItemCatMapF.addActionListener ( listener );
        menuItemCloseCollection.addActionListener ( new ListenerJFrameAdminCollection() );
        menuItemExit.addActionListener ( listener );
        menuItemGroupFile.addActionListener ( listener );
        menuItemIconFile.addActionListener ( listener );
        menuItemIconMapF.addActionListener ( listener );
        menuItemNewCollection.addActionListener ( listener );
        menuItemNewMapF.addActionListener ( listener );
        menuItemAdminCollection.addActionListener ( listener );
        menuItemOrderMapF.addActionListener ( listener );
        menuItemSearchAdvanced.addActionListener ( listener );
        
        
        menuItemExit.addActionListener ( listener );
        aboutMenuItem.addActionListener ( listener );
        contentsMenuItem.addActionListener ( listener );
        
        buttonOpenCollection.addActionListener ( listener );
        buttonSearchMapF.addActionListener ( listener );
        textFSearchMapF.addActionListener ( listener );
        textFSearchMapF.setActionCommand ("searchMapF");
        textFSearchMapF.addFocusListener (new FocusTextFSearchMapF ());
        
        radioButtonArbol.addActionListener ( listener );
        radioButtonLinea.addActionListener ( listener);
        
        buttonSearchAdvanced.addActionListener ( listener );
        
        
        // Para acceder a la barra de menus con la tecla alt
        fileMenu.setMnemonic (KeyEvent.VK_ALT);
        // Para situar el foco en el buscador pulsando alt+f
        jTxtBuscador.setFocusAccelerator ( 'f' );
        
        
        // Le ponemos un icono a este jFrame
        setIconImage ( new ImageIcon (getClass ().getResource ("/fmap/img/logo.png")).getImage () );
        // Centramos el formulario
        FormUtils.centra (this);
        
        
        
        glass = new FixedGlassPane (getJMenuBar (), getContentPane ());
//    glass.setLayout(new GridLayout(0, 1));
        
//        float c = new Float("0.0f").floatValue ();
//        float alfa = new Float(21.23).floatValue ();
        
//        glass.setBackground ( new Color (0.0f,0.0f,0.0f,0.1f));
//        glass.setBackground ( new Color (255,true));
        glass.setOpaque (false);
        
        setGlassPane (glass);
        
        pestana.setEnabledAt (1, false);
        
        setVisible (true);
    }
    
    
    /** Envia un texto a la JLabel que muestra errores/advertencias en la interfaz */
    public void setLblMsj (String txt)
    { lblMsj.setText (txt); }
    /** Obtiene la JLabel que muesta errores/advertencias */
    public javax.swing.JLabel getLblMsj ()
    { return lblMsj; }
    /** Obtiene el JTextField del buscador principal */
    public JTextField getTxtBuscador ()
    { return jTxtBuscador; }
    public JButton getButtonSearch ()
    { return buttonSearch; }
    public JButton getButtonNewMapF ()
    { return buttonNewMapF; }
    public JButton getButtonAdminCollection ()
    { return buttonAdminCollection; }
    public JTabbedPane getPestana ()
    { return pestana; }
    public JScrollPane getJspResultSearch ()
    {return jspResultSearch;}
    public JTextField getTextFSearchMapF ()
    { return textFSearchMapF; }
    public JComboBox getComboCollection ()
    { return comboCollection; }
    public FixedGlassPane getGlass ()
    { return glass; }
    public JRadioButton getRadioButtonArbol ()
    { return radioButtonArbol; }
    public JRadioButton getRadioButtonLinea ()
    { return radioButtonLinea; }
    public JCheckBox getCheckBoxCase ()
    { return checkBoxCase;}
    public JCheckBox getCheckBoxCaseMapF ()
    { return checkBoxCaseMapF;}
    public JSplitPane getSplitPane3()
    { return jSplitPane3;}
    public JSplitPane getSplitPane1()
    { return jSplitPane1;}



    /**
     * Activa todos los componentes de la interfaz principal, botones, buscador, menus
     */
    public void activeComponents ()
    {
/*
        buttonNewMapF.setEnabled ( true );
        buttonSearch.setEnabled ( true );
        jTxtBuscador.setEnabled ( true );
 */
        setLblMsj ( "" );
/*
        menuItemCloseCollection.setEnabled ( true );
        menuItemDeleteCollection.setEnabled ( true );
        menuItemNewMapF.setEnabled ( true );
        menuItemCloseMapF.setEnabled ( true );
        menuItemDeleteMapF.setEnabled ( true );
 */
    }
    
    
    /**
     * Desactiva todos los componentes de la interfaz principal, botones, buscador, menus
     */
    public void desActiveComponents ()
    {
/*        buttonNewMapF.setEnabled (false);
        buttonSearch.setEnabled ( false );
        jTxtBuscador.setEnabled ( false );
 */
        setLblMsj ( fmap.utils.IConstants.MSJ_COLECCION_NO_ABIERTA );
/*
        menuItemCloseCollection.setEnabled ( false );
        menuItemDeleteCollection.setEnabled ( false );
        menuItemNewMapF.setEnabled ( false );
        menuItemCloseMapF.setEnabled ( false );
        menuItemDeleteMapF.setEnabled ( false );
 */
    }
    
    /**
     * Clase que recoge los eventos de perdida y ganancia del
     * foco en el jTextBuscador para cambiar el color de fondo
     */
    class FocusTxtBuscador extends FocusAdapter
    {
        public void focusLost (FocusEvent ev)
        {
            jTxtBuscador.setBackground ( Color.WHITE );
        }
        
        public void focusGained (FocusEvent ev)
        {
            jTxtBuscador.setBackground ( new Color (209,224,239) );
        }
    }
    
    class FocusTextFSearchMapF extends FocusAdapter
    {
        public void focusLost (FocusEvent ev)
        {
            textFSearchMapF.setBackground ( Color.WHITE );
        }
        
        public void focusGained (FocusEvent ev)
        {
            textFSearchMapF.setBackground ( new Color (209,224,239) );
        }
    }
    
    
    /**
     * Inicia todos los componentes gr�ficos de este JFrame
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents()
    {
        jPopupMenu1 = new javax.swing.JPopupMenu();
        buttonGroupResultSearch = new javax.swing.ButtonGroup();
        jPanel2 = new javax.swing.JPanel();
        jToolBar2 = new javax.swing.JToolBar();
        buttonAdminCollection = new javax.swing.JButton();
        buttonNewMapF = new javax.swing.JButton();
        jSeparator3 = new javax.swing.JSeparator();
        buttonSearchAdvanced = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jSeparator4 = new javax.swing.JSeparator();
        comboCollection = new javax.swing.JComboBox();
        jSeparator5 = new javax.swing.JSeparator();
        buttonOpenCollection = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        lblMsj = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jTxtBuscador = new javax.swing.JTextField();
        buttonSearch = new javax.swing.JButton();
        jSplitPane1 = new javax.swing.JSplitPane();
        jSplitPane3 = new javax.swing.JSplitPane();
        pestana = new javax.swing.JTabbedPane();
        jspp = new javax.swing.JScrollPane();
        jPanelResultSearch = new javax.swing.JPanel();
        jspResultSearch = new javax.swing.JScrollPane();
        textFSearchMapF = new javax.swing.JTextField();
        buttonSearchMapF = new javax.swing.JButton();
        radioButtonArbol = new javax.swing.JRadioButton();
        radioButtonLinea = new javax.swing.JRadioButton();
        checkBoxCaseMapF = new javax.swing.JCheckBox();
        jLabel1 = new javax.swing.JLabel();
        checkBoxCase = new javax.swing.JCheckBox();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        menuItemNewCollection = new javax.swing.JMenuItem();
        menuItemNewMapF = new javax.swing.JMenuItem();
        jSeparator6 = new javax.swing.JSeparator();
        menuItemAdminCollection = new javax.swing.JMenuItem();
        menuItemCloseCollection = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JSeparator();
        menuItemExit = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        menuItemOrderMapF = new javax.swing.JMenu();
        contentsMenuItem1 = new javax.swing.JMenuItem();
        aboutMenuItem1 = new javax.swing.JMenuItem();
        contentsMenuItem2 = new javax.swing.JMenuItem();
        aboutMenuItem2 = new javax.swing.JMenuItem();
        jSeparator7 = new javax.swing.JSeparator();
        menuItemCatMapF = new javax.swing.JMenuItem();
        menuItemGroupFile = new javax.swing.JMenuItem();
        menuItemIconFile = new javax.swing.JMenuItem();
        menuItemIconMapF = new javax.swing.JMenuItem();
        jSeparator8 = new javax.swing.JSeparator();
        menuItemSearchAdvanced = new javax.swing.JMenuItem();
        helpMenu = new javax.swing.JMenu();
        contentsMenuItem = new javax.swing.JMenuItem();
        aboutMenuItem = new javax.swing.JMenuItem();

        getContentPane().setLayout(new java.awt.BorderLayout(1, 0));

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Fmap - beta 2");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jPanel2.setLayout(new java.awt.BorderLayout());

        jToolBar2.setFocusable(false);
        jToolBar2.setMaximumSize(new java.awt.Dimension(33272, 36));
        jToolBar2.setMinimumSize(new java.awt.Dimension(306, 36));
        jToolBar2.setOpaque(false);
        buttonAdminCollection.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/coleccion.png")));
        buttonAdminCollection.setToolTipText("Gestionar colecciones");
        buttonAdminCollection.setActionCommand("adminCollection");
        buttonAdminCollection.setBorder(null);
        buttonAdminCollection.setFocusPainted(false);
        buttonAdminCollection.setFocusable(false);
        buttonAdminCollection.setMaximumSize(new java.awt.Dimension(35, 30));
        buttonAdminCollection.setMinimumSize(new java.awt.Dimension(35, 30));
        buttonAdminCollection.setPreferredSize(new java.awt.Dimension(35, 30));
        jToolBar2.add(buttonAdminCollection);

        buttonNewMapF.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/nuevo_mapa_ficheros.png")));
        buttonNewMapF.setToolTipText("Nuevo Volumen de ficheros");
        buttonNewMapF.setActionCommand("newMapF");
        buttonNewMapF.setBorder(null);
        buttonNewMapF.setFocusPainted(false);
        buttonNewMapF.setFocusable(false);
        buttonNewMapF.setMaximumSize(new java.awt.Dimension(35, 30));
        buttonNewMapF.setMinimumSize(new java.awt.Dimension(35, 30));
        buttonNewMapF.setPreferredSize(new java.awt.Dimension(35, 30));
        jToolBar2.add(buttonNewMapF);

        jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator3.setMaximumSize(new java.awt.Dimension(5, 20));
        jSeparator3.setPreferredSize(new java.awt.Dimension(10, 10));
        jToolBar2.add(jSeparator3);

        buttonSearchAdvanced.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/_find.png")));
        buttonSearchAdvanced.setActionCommand("searchAdvanced");
        buttonSearchAdvanced.setBorder(null);
        buttonSearchAdvanced.setFocusable(false);
        buttonSearchAdvanced.setMaximumSize(new java.awt.Dimension(35, 30));
        buttonSearchAdvanced.setMinimumSize(new java.awt.Dimension(35, 30));
        jToolBar2.add(buttonSearchAdvanced);

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/arrow_refresh.png")));
        jButton3.setBorder(null);
        jButton3.setFocusPainted(false);
        jButton3.setMaximumSize(new java.awt.Dimension(32, 32));
        jButton3.setMinimumSize(new java.awt.Dimension(32, 32));
        jToolBar2.add(jButton3);

        jSeparator4.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator4.setMaximumSize(new java.awt.Dimension(50, 20));
        jToolBar2.add(jSeparator4);

        comboCollection.setFont(new java.awt.Font("Dialog", 0, 10));
        comboCollection.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        comboCollection.setMaximumSize(new java.awt.Dimension(200, 20));
        jToolBar2.add(comboCollection);

        jSeparator5.setBackground(new java.awt.Color(238, 238, 238));
        jSeparator5.setForeground(new java.awt.Color(238, 238, 238));
        jSeparator5.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator5.setMaximumSize(new java.awt.Dimension(3, 32));
        jToolBar2.add(jSeparator5);

        buttonOpenCollection.setFont(new java.awt.Font("Dialog", 0, 11));
        buttonOpenCollection.setText("Abrir colecci\u00f3n");
        buttonOpenCollection.setActionCommand("openCollection");
        buttonOpenCollection.setBorder(null);
        buttonOpenCollection.setFocusable(false);
        buttonOpenCollection.setMaximumSize(new java.awt.Dimension(92, 20));
        buttonOpenCollection.setPreferredSize(new java.awt.Dimension(104, 32));
        jToolBar2.add(buttonOpenCollection);

        jPanel2.add(jToolBar2, java.awt.BorderLayout.NORTH);

        getContentPane().add(jPanel2, java.awt.BorderLayout.NORTH);

        jPanel1.setBorder(javax.swing.BorderFactory.createCompoundBorder());
        jPanel1.setMaximumSize(new java.awt.Dimension(3277, 3277));
        lblMsj.setForeground(new java.awt.Color(255, 0, 0));
        lblMsj.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lblMsj.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/exclamation.png")));
        lblMsj.setFocusable(false);

        jTxtBuscador.setFont(new java.awt.Font("Dialog", 1, 10));
        jTxtBuscador.setAlignmentY(1.0F);

        buttonSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/magnifier.png")));
        buttonSearch.setText("Buscar");
        buttonSearch.setActionCommand("search");
        buttonSearch.setAlignmentY(0.7F);
        buttonSearch.setMargin(new java.awt.Insets(2, 14, 2, 20));
        buttonSearch.setMaximumSize(new java.awt.Dimension(53, 20));
        buttonSearch.setMinimumSize(new java.awt.Dimension(75, 20));

        jSplitPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jSplitPane1.setDividerLocation(230);
        jSplitPane1.setDividerSize(8);
        jSplitPane1.setResizeWeight(0.1);
        jSplitPane1.setOneTouchExpandable(true);
        jSplitPane3.setDividerLocation(350);
        jSplitPane3.setDividerSize(8);
        jSplitPane3.setResizeWeight(1.0);
        jSplitPane3.setOneTouchExpandable(true);
        pestana.setBackground(new java.awt.Color(255, 255, 255));
        pestana.setFont(new java.awt.Font("Arial", 1, 12));
        jspp.setOpaque(false);
        pestana.addTab("tab3", jspp);

        jPanelResultSearch.setFocusable(false);
        jspResultSearch.setBackground(new java.awt.Color(255, 255, 255));
        jspResultSearch.setAutoscrolls(true);
        jspResultSearch.setFocusable(false);

        buttonSearchMapF.setText("Buscar");
        buttonSearchMapF.setActionCommand("searchMapF");
        buttonSearchMapF.addMouseListener(new java.awt.event.MouseAdapter()
        {
            public void mouseClicked(java.awt.event.MouseEvent evt)
            {
                buttonSearchMapFMouseClicked(evt);
            }
        });

        buttonGroupResultSearch.add(radioButtonArbol);
        radioButtonArbol.setSelected(true);
        radioButtonArbol.setText("En arbol");
        radioButtonArbol.setActionCommand("typeResultSearch");
        radioButtonArbol.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        radioButtonArbol.setFocusable(false);
        radioButtonArbol.setMargin(new java.awt.Insets(0, 0, 0, 0));

        buttonGroupResultSearch.add(radioButtonLinea);
        radioButtonLinea.setText("En linea");
        radioButtonLinea.setActionCommand("typeResultSearch");
        radioButtonLinea.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        radioButtonLinea.setFocusable(false);
        radioButtonLinea.setMargin(new java.awt.Insets(0, 0, 0, 0));

        checkBoxCaseMapF.setFont(new java.awt.Font("Dialog", 0, 12));
        checkBoxCaseMapF.setText("Coincidir Mayusculas/Minusculas");
        checkBoxCaseMapF.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        checkBoxCaseMapF.setMargin(new java.awt.Insets(0, 0, 0, 0));

        jLabel1.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel1.setText("Ver resultados de la busqueda:");

        org.jdesktop.layout.GroupLayout jPanelResultSearchLayout = new org.jdesktop.layout.GroupLayout(jPanelResultSearch);
        jPanelResultSearch.setLayout(jPanelResultSearchLayout);
        jPanelResultSearchLayout.setHorizontalGroup(
            jPanelResultSearchLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanelResultSearchLayout.createSequentialGroup()
                .addContainerGap()
                .add(jPanelResultSearchLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanelResultSearchLayout.createSequentialGroup()
                        .add(textFSearchMapF, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(buttonSearchMapF)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(checkBoxCaseMapF, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 220, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jPanelResultSearchLayout.createSequentialGroup()
                        .add(jLabel1)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(radioButtonArbol)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(radioButtonLinea)))
                .addContainerGap())
            .add(jspResultSearch, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
        );
        jPanelResultSearchLayout.setVerticalGroup(
            jPanelResultSearchLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanelResultSearchLayout.createSequentialGroup()
                .addContainerGap()
                .add(jPanelResultSearchLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(textFSearchMapF, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(buttonSearchMapF, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(checkBoxCaseMapF))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanelResultSearchLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel1)
                    .add(radioButtonArbol)
                    .add(radioButtonLinea))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jspResultSearch, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 401, Short.MAX_VALUE))
        );
        pestana.addTab("tab2", jPanelResultSearch);

        jSplitPane3.setLeftComponent(pestana);

        jSplitPane1.setRightComponent(jSplitPane3);

        checkBoxCase.setFont(new java.awt.Font("Dialog", 0, 12));
        checkBoxCase.setText("Coincidir Mayusculas/Minusculas");
        checkBoxCase.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        checkBoxCase.setMargin(new java.awt.Insets(0, 0, 0, 0));

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 808, Short.MAX_VALUE)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jTxtBuscador, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 220, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(buttonSearch, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 101, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(15, 15, 15)
                .add(checkBoxCase)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(lblMsj, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE)
                .addContainerGap())
            .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 808, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE)
                .add(8, 8, 8)
                .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(buttonSearch, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(checkBoxCase)
                        .add(lblMsj))
                    .add(jTxtBuscador, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

        menuBar.setFont(new java.awt.Font("Dialog", 0, 12));
        fileMenu.setText("Archivo");
        fileMenu.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemNewCollection.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemNewCollection.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/page_white_star.png")));
        menuItemNewCollection.setText("Nueva colecci\u00f3n");
        menuItemNewCollection.setActionCommand("adminCollection");
        fileMenu.add(menuItemNewCollection);

        menuItemNewMapF.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemNewMapF.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/nuevo_mapa_ficheros.png")));
        menuItemNewMapF.setText("Nuevo volumen");
        menuItemNewMapF.setActionCommand("newMapF");
        fileMenu.add(menuItemNewMapF);

        fileMenu.add(jSeparator6);

        menuItemAdminCollection.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemAdminCollection.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/coleccion_abrir.png")));
        menuItemAdminCollection.setText("Colecciones");
        menuItemAdminCollection.setActionCommand("adminCollection");
        fileMenu.add(menuItemAdminCollection);

        menuItemCloseCollection.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemCloseCollection.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/spacer.png")));
        menuItemCloseCollection.setText("Cerrar colecci\u00f3n");
        menuItemCloseCollection.setActionCommand("buttonCerrar");
        menuItemCloseCollection.setName("");
        fileMenu.add(menuItemCloseCollection);

        fileMenu.add(jSeparator2);

        menuItemExit.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemExit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/door_out.png")));
        menuItemExit.setText("Salir");
        menuItemExit.setActionCommand("exit");
        fileMenu.add(menuItemExit);

        menuBar.add(fileMenu);

        jMenu1.setText("Editar");
        jMenu1.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemOrderMapF.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/spacer.png")));
        menuItemOrderMapF.setText("Ordenar volumenes");
        menuItemOrderMapF.setFont(new java.awt.Font("Dialog", 0, 12));
        contentsMenuItem1.setFont(new java.awt.Font("Dialog", 0, 12));
        contentsMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/arrow_down.png")));
        contentsMenuItem1.setText("Nombre [ascendente]");
        menuItemOrderMapF.add(contentsMenuItem1);

        aboutMenuItem1.setFont(new java.awt.Font("Dialog", 0, 12));
        aboutMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/arrow_up.png")));
        aboutMenuItem1.setText("Nombre [descendente]");
        aboutMenuItem1.setActionCommand("acercaDe");
        menuItemOrderMapF.add(aboutMenuItem1);

        contentsMenuItem2.setFont(new java.awt.Font("Dialog", 0, 12));
        contentsMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/arrow_down.png")));
        contentsMenuItem2.setText("N\u00ba resultados [ascendente]");
        menuItemOrderMapF.add(contentsMenuItem2);

        aboutMenuItem2.setFont(new java.awt.Font("Dialog", 0, 12));
        aboutMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/arrow_up.png")));
        aboutMenuItem2.setText("N\u00ba resultados [descendente]");
        aboutMenuItem2.setActionCommand("acercaDe");
        menuItemOrderMapF.add(aboutMenuItem2);

        jMenu1.add(menuItemOrderMapF);

        jMenu1.add(jSeparator7);

        menuItemCatMapF.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemCatMapF.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/cat_edit.png")));
        menuItemCatMapF.setText("Categorias volumenes");
        menuItemCatMapF.setActionCommand("menuItemCatMapF");
        menuItemCatMapF.setName("cerrar");
        jMenu1.add(menuItemCatMapF);

        menuItemGroupFile.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemGroupFile.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/groupFile.png")));
        menuItemGroupFile.setText("Grupos de ficheros");
        menuItemGroupFile.setActionCommand("menuItemGroupFile");
        menuItemGroupFile.setName("");
        jMenu1.add(menuItemGroupFile);

        menuItemIconFile.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemIconFile.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/spacer.png")));
        menuItemIconFile.setText("Iconos ficheros");
        menuItemIconFile.setActionCommand("menuItemIconFile");
        menuItemIconFile.setName("cerrar");
        jMenu1.add(menuItemIconFile);

        menuItemIconMapF.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemIconMapF.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/icoMapF.png")));
        menuItemIconMapF.setText("Iconos volumenes");
        menuItemIconMapF.setActionCommand("menuItemIconMapF");
        menuItemIconMapF.setName("cerrar");
        jMenu1.add(menuItemIconMapF);

        jMenu1.add(jSeparator8);

        menuItemSearchAdvanced.setFont(new java.awt.Font("Dialog", 0, 12));
        menuItemSearchAdvanced.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/find.png")));
        menuItemSearchAdvanced.setText("B\u00fasqueda avanzada");
        menuItemSearchAdvanced.setActionCommand("searchAdvanced");
        menuItemSearchAdvanced.setName("cerrar");
        jMenu1.add(menuItemSearchAdvanced);

        menuBar.add(jMenu1);

        helpMenu.setText("Ayuda");
        helpMenu.setFont(new java.awt.Font("Dialog", 0, 12));
        contentsMenuItem.setFont(new java.awt.Font("Dialog", 0, 12));
        contentsMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/help.png")));
        contentsMenuItem.setText("Contenido de la ayuda");
        contentsMenuItem.setActionCommand("Contents");
        helpMenu.add(contentsMenuItem);

        aboutMenuItem.setFont(new java.awt.Font("Dialog", 0, 12));
        aboutMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fmap/img/comment.png")));
        aboutMenuItem.setText("Acerca de...");
        aboutMenuItem.setActionCommand("acercaDe");
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    private void buttonSearchMapFMouseClicked (java.awt.event.MouseEvent evt)//GEN-FIRST:event_buttonSearchMapFMouseClicked
    {//GEN-HEADEREND:event_buttonSearchMapFMouseClicked
        
        
        
// TODO add your handling code here:
    }//GEN-LAST:event_buttonSearchMapFMouseClicked
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.JMenuItem aboutMenuItem1;
    private javax.swing.JMenuItem aboutMenuItem2;
    private javax.swing.JButton buttonAdminCollection;
    private javax.swing.ButtonGroup buttonGroupResultSearch;
    private javax.swing.JButton buttonNewMapF;
    private javax.swing.JButton buttonOpenCollection;
    private javax.swing.JButton buttonSearch;
    private javax.swing.JButton buttonSearchAdvanced;
    private javax.swing.JButton buttonSearchMapF;
    private javax.swing.JCheckBox checkBoxCase;
    private javax.swing.JCheckBox checkBoxCaseMapF;
    private javax.swing.JComboBox comboCollection;
    private javax.swing.JMenuItem contentsMenuItem;
    private javax.swing.JMenuItem contentsMenuItem1;
    private javax.swing.JMenuItem contentsMenuItem2;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanelResultSearch;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JSeparator jSeparator6;
    private javax.swing.JSeparator jSeparator7;
    private javax.swing.JSeparator jSeparator8;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JSplitPane jSplitPane3;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JTextField jTxtBuscador;
    private javax.swing.JScrollPane jspResultSearch;
    private javax.swing.JScrollPane jspp;
    private javax.swing.JLabel lblMsj;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenuItem menuItemAdminCollection;
    private javax.swing.JMenuItem menuItemCatMapF;
    private javax.swing.JMenuItem menuItemCloseCollection;
    private javax.swing.JMenuItem menuItemExit;
    private javax.swing.JMenuItem menuItemGroupFile;
    private javax.swing.JMenuItem menuItemIconFile;
    private javax.swing.JMenuItem menuItemIconMapF;
    private javax.swing.JMenuItem menuItemNewCollection;
    private javax.swing.JMenuItem menuItemNewMapF;
    private javax.swing.JMenu menuItemOrderMapF;
    private javax.swing.JMenuItem menuItemSearchAdvanced;
    private javax.swing.JTabbedPane pestana;
    private javax.swing.JRadioButton radioButtonArbol;
    private javax.swing.JRadioButton radioButtonLinea;
    private javax.swing.JTextField textFSearchMapF;
    // End of variables declaration//GEN-END:variables
//    private JScrollPane jspResultSearch;
}
